Powerset::fold specialization
#765
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to #755
powerset_0_fold(µs)powerset_1_fold(µs)powerset_2_fold(µs)powerset_4_fold(µs)powerset_8_fold(µs)powerset_12_fold(µs)[321.26 322.12 323.18][395.73 396.62 397.61][353.65 355.59 357.87][333.72 334.66 335.72][321.30 321.79 322.31][318.88 319.67 320.71][312.58 312.94 313.29][375.18 375.65 376.12][330.77 331.83 332.96][298.66 299.17 299.72][289.46 289.81 290.18][289.31 289.68 290.16](k+1..=n).fold[320.78 322.00 323.43][383.65 384.39 385.30][349.08 350.11 351.12][315.60 316.55 317.63][304.82 305.70 306.59][296.88 297.81 299.03]So it's 10% faster than without specialization for
powerset_{4,8,12}_fold(and 3% to 7% forn=0,1,2).And
(it.k() + 1..=it.n()).foldmakes it (intermediary) slower (so it's not pushed here).Once
Combinations::foldis implemented, it should be even faster.EDIT: Sorry, the table does not render well.